﻿
@{
    ViewBag.Title = "LawDocumentAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css{
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <style>
        .required {
            color: red;
        }

        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }

        .center {
            position: fixed;
            top: 50%;
            left: 50%;
            background-color: #000;
            width: 600px;
            -webkit-transform: translateX(-50%) translateY(-50%);
            -moz-transform: translateX(-50%) translateY(-50%);
            -ms-transform: translateX(-50%) translateY(-50%);
            transform: translateX(-50%) translateY(-50%);
            border-radius: 3px;
        }
    </style>
}
<section id="content" class="page-content" ng-cloak ng-controller="GuestController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
         GetGuestEduPageList(SearchModel,page);
">
    <div class="page-heading">
        <h1>访客清单</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>教育培训</a></li>
        <li class="active"><a>公司访客清单</a></li>
    </ol>
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg">正在加载</div>
        </div>
    </div>
    <div class="load" id="previewimg" ng-show="IsPreview" ng-click="ClosePreview();">
        <img id="imgshow" class="center" />
    </div>
    <form class="form-horizontal">
        <div class="panel">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-filter"></span>搜索过滤
                </span>
            </div>
            <div class="panel-body fill">
                <div class="row">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">来访单位</label>
                        <div class="col-lg-2">
                            <input type="text" class="form-control" ng-model="SearchModel.GuestCompany" placeholder="来访单位模糊查询" />
                        </div>
                        <label class="col-sm-1 control-label">访客姓名</label>
                        <div class="col-lg-2">
                            <input type="text" class="form-control" ng-model="SearchModel.GuestName" placeholder="访客姓名模糊查询" />
                        </div>
                        <label class="col-sm-1 control-label">访客手机</label>
                        <div class="col-lg-2">
                            <input type="text" class="form-control" ng-model="SearchModel.MobilePhone" placeholder="访客手机模糊查询" />
                        </div>
                        <label class="col-sm-1 control-label">访客证件</label>
                        <div class="col-lg-2">
                            <input type="text" class="form-control" ng-model="SearchModel.IdCardNo" placeholder="访客证件模糊查询" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">开始时间</label>
                        <div class="col-lg-2">
                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.StartTime"></datepicker>
                        </div>
                        <label class="col-sm-1 control-label">结束时间</label>
                        <div class="col-lg-2">
                            <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.EndTime"></datepicker>
                        </div>
                        <div class="col-lg-1">
                            <button class="btn btn-primary" ng-click="GetGuestEduPageList(SearchModel,page);">查询</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-list"></span>访客 总数：{{result.totalItemCount}}
                </span>
                <div class="widget-menu pull-right mr10">
                    <a data-toggle="modal" href="#ImportModal" class="btn btn-xs btn-inverse"><i class="fa fa-plus"></i>数据导入</a>
                </div>
            </div>
            <div class="panel-body">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th style="width:2%;">序号</th>
                            <th style="width:8%;">来访单位</th>
                            <th style="width:5%;">来访日期</th>
                            <th style="width:5%;">访客姓名</th>
                            <th style="width:5%;">手机号码</th>
                            <th style="width:5%;">证件号</th>
                            <th style="width:5%;">车牌</th>
                            <th style="width:5%;">接待人</th>
                            <th style="width:5%;">状态</th>
                            <th style="width:5%;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-show="GuestSafetyEduList.length==0 && !DataLoading">
                            <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                        </tr>
                        <tr ng-repeat="x in GuestSafetyEduList">
                            <td style="text-align:center;">
                                <span>{{((result.currentPage-1)*20)+($index+1)}}</span>
                            </td>
                            <td style="text-align:center;" ng-bind="x.GuestCompany"></td>
                            <td style="text-align:center;">{{x.VisitDate|JSONDate:'yyyy-MM-dd HH:mm'}}</td>
                            <td style="text-align:center;" ng-bind="x.GuestName"></td>
                            <td style="text-align:center;" ng-bind="x.MobilePhone"></td>
                            <td style="text-align:center;" ng-bind="x.IdCardNo"></td>
                            <td style="text-align:center;" ng-bind="x.CarNo"></td>
                            <td style="text-align:center;">{{x.Employee}}{{x.EmployeePhone}}</td>
                            <td style="text-align:center;"><span ng-show="x.Status==0">已登记</span><span ng-show="x.Status==1">已安全学习</span></td>
                            <td style="text-align:center;">
                                <a data-toggle="modal" href="#InfoModal" ng-click="ShowGuestDetail(x);" class="btn btn-primary btn-xs btn-label"><i class="fa fa-info-circle"></i> 详细</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="text-center" ng-show="GuestSafetyEduList!=null && GuestSafetyEduList.length>0">
            <ul class="pagination  justify-content-center">
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetGuestEduPageList(SearchModel,1);">首页</a></li>
                <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetGuestEduPageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetGuestEduPageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetGuestEduPageList(SearchModel,result.totalPage);">尾页</a></li>
            </ul>
        </div>
    </form>
    <div class="modal fade" id="InfoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">访客申请信息</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">来访单位</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.GuestCompany" placeholder="" disabled />
                            </div>
                            <label class="col-sm-1 control-label">访客姓名</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.GuestName" placeholder="" disabled />
                            </div>

                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">访客手机</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.MobilePhone" placeholder="" disabled />
                            </div>
                            <label class="col-sm-1 control-label">访客证件</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.IdCardNo" placeholder="" disabled />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">车牌</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.CarNo" placeholder="" disabled />
                            </div>
                            <label class="col-sm-1 control-label">来访时间</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" value="{{CurrentModel.VisitTime}}" placeholder="" disabled />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">来访事由</label>
                            <div class="col-lg-9">
                                <input type="text" class="form-control" ng-model="CurrentModel.Reason" placeholder="" disabled />
                            </div>

                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">接待部门</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.DepartmentName" placeholder="" disabled />
                            </div>
                            <label class="col-sm-1 control-label">接待人</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" value="{{CurrentModel.UserName}}" placeholder="" disabled />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">当前状态</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.StatusName" placeholder="" disabled />
                            </div>
                            <label class="col-sm-1 control-label">随访人数</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="CurrentModel.PersonNum" placeholder="" disabled />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">照片</label>
                            <div class="col-lg-1" ng-repeat="x in CurrentModel.FileList">
                                <img ng-src="{{'../../' + x }}" ng-click="ShowPicture('../../' + x );" width="100" style="margin-left:20px;" />
                            </div>
                        </div>
                        <div ng-repeat="y in CurrentModel.FollowList">
                            <h5>随访人 {{$index+1}}</h5>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"> 访客姓名</label>
                                <div class="col-lg-4">
                                    <input type="text" class="form-control" ng-model="y.GuestName" placeholder="" disabled />
                                </div>
                                <label class="col-sm-1 control-label">访客证件</label>
                                <div class="col-lg-4">
                                    <input type="text" class="form-control" ng-model="y.IdCardNo" placeholder="" disabled />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">访客手机</label>
                                <div class="col-lg-4">
                                    <input type="text" class="form-control" ng-model="y.MobilePhone" placeholder="" disabled />
                                </div>
                                <label class="col-sm-1 control-label">车牌</label>
                                <div class="col-lg-4">
                                    <input type="text" class="form-control" ng-model="y.CarNo" placeholder="" disabled />
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close2">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" id="ImportModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">导入访客清单</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">导入模板</label>
                            <div class="col-lg-9">
                                <label class="control-label"><a href="~/File/Templete/导入部门模板.xls">点击下载导入部门模板</a></label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-1 control-label">上传模板</label>
                            <div class="col-lg-9">
                                <input type="file" ngf-select ng-model="doc.Files" name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" accept=".xls,.xlsx" required>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" ng-click="ImportGuestEdu();">上传</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close2">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</section>

@section Js{

    <script src="~/Assets/js/pg/GuestTraining.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
    </script>
}


